#ifndef TICKSHEETWINDOW_H
#define TICKSHEETWINDOW_H

#include <QtGui/QMainWindow>
#include <QDate>
#include <QMap>
#include <QDir>

#include "../recordedtime.h"
#include "../ticksheet.h"

class QTime;
class QTimer;
class QTreeView;
class QStandardItemModel;
class QSqlTableModel;
class QCompleter;

namespace Ui
{
    class TicksheetWindow;
}

class TicksheetWindow : public QMainWindow
{
    Q_OBJECT

public:
    TicksheetWindow(QWidget *parent = 0);
    ~TicksheetWindow();

protected:
    QString             calcTimeString(int);
    void                saveFile(QString filename);
    void                makeDir();

private:
    Ui::TicksheetWindow *ui;

    Ticksheet*           mCurrentTicksheet;
    QTreeView*           mTreeView;
    QStandardItemModel*  mRecordedTimesModel;
    bool                 mIsRunning;
    QDir                 mRootDir;

private slots:

    void                 on_startButton_clicked();
    void                 on_restartButton_clicked();
    void                 on_recordButton_clicked();
    void                 on_noteEdit_returnPressed();
    void                 on_noteEdit_textChanged ( const QString & text );
    void                 on_actionSave_triggered();
    void                 on_actionQuickSave_triggered();
    void                 on_actionToggleWarning_triggered();
    void                 on_actionRecord_triggered();
    void                 on_timerChanged(const QString&);

};

#endif // TICKSHEETWINDOW_H
